package com.xinsoft.controller.basic;

import com.xinsoft.common.Response;
import com.xinsoft.entity.po.SysUserReport;
import com.xinsoft.service.SysUserReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/sys/sysUserReport")
public class SysUserReportController {

    @Autowired
    private SysUserReportService sysUserReportService;
    /**
     * 更新
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("/edit")
    public Response<?> edit(@RequestBody List<SysUserReport> sysUserReportList) {
        sysUserReportService.edit(sysUserReportList);
        return Response.succeed();
    }

    /**
     * 分页
     */
    @PostMapping("/list")
    public Response<?> pageList() {
        return Response.succeed(sysUserReportService.findList());
    }
}
